<script setup lang="ts">
import { defineEmits } from 'vue';

interface Props {
  folderData?: any[];
}

const props = withDefaults(defineProps<Props>(), {
  folderData: () => []
});


const emit = defineEmits(['update-value']);

function handleJumpFolder(item: any): any {
  emit('update-value', 3, item);
}

</script>

<template>
  <div class="w-full">
    <div v-if="folderData.length > 0" class="files">
      <div v-for="item in folderData" :key="item.id" class="file" @click="handleJumpFolder(item)">
        <img class="typeImg" src="@/assets/bid-materials/folder.png" alt="" />
        <div class="fileName">{{ item.folderName }}</div>
      </div>
    </div>
    <div v-else class="files">
      <NEmpty description="暂无内容" />
    </div>
  </div>
</template>

<style scoped lang="scss">
.title {
  font-weight: 500;
  font-size: 22px;
  color: #333333;
  line-height: 48px;
  padding-left: 32px;
  margin-top: 10px;
  border-bottom: #ebeef5 1px solid;
}
.files {
  padding-top: 20px;
  width: 1583px;
  height: 650px;
  display: flex;
  flex-wrap: wrap;
  .file {
    width: 281px;
    height: 180px;
    border-radius: 12px;
    border: 1px solid #ebeef5;
    margin: 16px 16px;
    position: relative;
    &:hover {
      background: #f3f4f8;
      cursor: pointer;
    }
    .typeImg {
      position: absolute;
      top: 44px;
      left: 106px;
      width: 70px;
      height: 59px;
    }
    .fileName {
      text-align: center;
      width: 281px;
      padding: 0 30px;
      margin-top: 120px;
      font-weight: 400;
      font-size: 18px;
      color: #333333;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      line-clamp: 1; /* 这里的3表示最多显示2行 */
      overflow: hidden;
    }
  }
}
</style>
